#include <list>
#include <sstream>
#include <numeric>
#include <algorithm>
#include <string>

#include <sqlite3.h>

#include "client.h"
#include "ds.h"

using namespace std;

class server : public client

{
	public:
		server(const char *ip,const char *port);
		~server(); 
	private:
		int regist(void);
		int login(void);
		int logout(void);
		int message(void);

		
		bool user_check_exist(struct sockaddr_in user);
		int fs_write_message(struct message_t message);
		int get_time(string &_sTime);

		virtual int child_process(void) override;
		virtual int parent_process(void) override;


		list<struct sockaddr_in> clients;
		list<struct sockaddr_in>::iterator client_itor;
		
		ds myDs;
};
